import { COMPONENT_TYPE } from '../../../../../libs/constants'

export default [
  {
    id: '1',
    type: COMPONENT_TYPE.INPUT,
    formItem: {
      layout: {
        span: 12,
        offset: 0
      },
      prop: 'name',
      rules: [
        { required: true, message: '请输入按钮名称', trigger: 'blur' },
        { min: 3, message: '按钮名称最小长度为3个字符', trigger: 'blur' }
      ],
      label: '按钮名称',
      extra: '按钮名称方便查找使用',
    },
    attrs: {
      value: 'key_' + Date.now(),
      type: 'text',
      allowClear: true,
      placeholder: '请输入按钮名称'
    }
  },
  {
    id: '2',
    type: COMPONENT_TYPE.SWITCH,
    formItem: {
      layout: {
        span: 12,
        offset: 0
      },
      prop: 'show',
      rules: [],
      label: '显示按钮',
      extra: '显示按钮，动态进行控制按钮',
    },
    attrs: {
      checked: true
    }
  },
  {
    id: '3',
    type: COMPONENT_TYPE.SELECT,
    formItem: {
      layout: {
        span: 12,
        offset: 0
      },
      prop: 'type',
      rules: [],
      label: '按钮类型',
      extra: '提交按钮类型 primary| default | dashed | danger | link',
    },
    attrs: {
      value: 'primary',
      children: [
        {
          value: 'primary',
          label: 'primary'
        },
        {
          value: 'default',
          label: 'default'
        },
        {
          value: 'dashed',
          label: 'dashed'
        },
        {
          value: 'danger',
          label: 'danger'
        },
        {
          value: 'link',
          label: 'link'
        }
      ]
    }
  },
  {
    id: '4',
    type: COMPONENT_TYPE.INPUT,
    formItem: {
      layout: {
        span: 12,
        offset: 0
      },
      prop: 'icon',
      rules: [],
      label: '按钮图标',
      extra: '参考Icon图标名称',
    },
    attrs: {
      value: 'save',
      type: 'text',
      allowClear: true,
      placeholder: '请输入按钮图标'
    }
  },
  {
    id: '5',
    type: COMPONENT_TYPE.INPUT,
    formItem: {
      layout: {
        span: 12,
        offset: 0
      },
      prop: 'text',
      rules: [],
      label: '按钮内容',
      extra: '按钮显示的文字内容',
    },
    attrs: {
      value: '提交',
      type: 'text',
      allowClear: true,
      placeholder: '请输入按钮内容'
    }
  },
  {
    id: '6',
    type: COMPONENT_TYPE.RADIO_BUTTON,
    formItem: {
      layout: {
        span: 12,
        offset: 0
      },
      prop: 'shape',
      rules: [],
      label: '按钮形状',
      extra: '设置按钮形状，可选值为 circle、 round、circle-outline 或者不设',
    },
    attrs: {
      value: '-',
      buttonStyle: 'solid',
      children: [
        {
          value: '-',
          label: '-'
        },
        {
          value: 'circle',
          label: 'circle'
        },
        {
          value: 'round',
          label: 'round'
        }
      ]
    }
  },
  {
    id: '7',
    type: COMPONENT_TYPE.RADIO_BUTTON,
    formItem: {
      layout: {
        span: 12,
        offset: 0
      },
      prop: 'size',
      rules: [],
      label: '按钮大小',
      extra: '设置按钮大小，可选值为 small large 或者不设',
    },
    attrs: {
      value: 'default',
      buttonStyle: 'solid',
      children: [
        {
          value: 'default',
          label: 'default'
        },
        {
          value: 'small',
          label: 'small'
        },
        {
          value: 'large',
          label: 'large'
        }
      ]
    }
  },
  {
    id: '8',
    type: COMPONENT_TYPE.SWITCH,
    formItem: {
      layout: {
        span: 12,
        offset: 0
      },
      prop: 'disabled',
      rules: [],
      label: '禁用按钮',
      extra: '禁用按钮，动态进行控制按钮',
    },
    attrs: {
      checked: false
    }
  },
  {
    id: '9',
    type: COMPONENT_TYPE.SWITCH,
    formItem: {
      layout: {
        span: 12,
        offset: 0
      },
      prop: 'ghost',
      rules: [],
      label: '幽灵属性',
      extra: '幽灵属性，使按钮背景透明',
    },
    attrs: {
      checked: false
    }
  },
  {
    id: '10',
    type: COMPONENT_TYPE.SWITCH,
    formItem: {
      layout: {
        span: 12,
        offset: 0
      },
      prop: 'loading',
      rules: [],
      label: '载入状态',
      extra: 'loading 设置按钮载入状态',
    },
    attrs: {
      checked: false
    }
  },
  {
    id: '11',
    type: COMPONENT_TYPE.SWITCH,
    formItem: {
      layout: {
        span: 12,
        offset: 0
      },
      prop: 'block',
      rules: [],
      label: '按钮宽度',
      extra: '将按钮宽度调整为其父宽度的选项',
    },
    attrs: {
      checked: false
    }
  }
]

